<?php
/**
  * @version $Id: wp-feed.php,v 0.15 2007/08/07 11:55:55 visualweb Exp $ 
  * @package com_mojo
  * @copyright (c) 1guywebdesign.com 
  * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
  *
  * revised to include patch for security issues noted in jdwp v2_rc2 
  */
 
var_dump('rework feed');
if (!defined('ABSPATH')) {
	define( '_VALID_MOS', 1 );

	include_once( '../../globals.php' );
	require_once( '../../configuration.php' );
	require_once( '../../includes/joomla.php' );
	require_once( '../../includes/sef.php' );

	global $mosConfig_absolute_path, $mosConfig_live_site, $database;

	$mainframe = new mosMainFrame( $database, isset($option), '.' );
	$mainframe->initSession();
	$my = $mainframe->getUser();

	$user=null;
	if ($my->id) {
	$query = "SELECT *"
	. "\n FROM #__users"
	. "\n WHERE id = ". intval( $my->id )
	;
	$database->setQuery( $query );
	$database->loadObject($user);
	}
	$database->setQuery("SELECT id FROM #__menu WHERE link='index.php?option=com_mojo' AND published='1'");
    $Itemid = $database->loadResult();
}

if (empty($doing_rss)) {
    $doing_rss = 1;
    require(dirname(__FILE__) . '/wp-blog-header.php');
}

// Remove the pad, if present.
$feed = preg_replace('/^_+/', '', $feed);

if ($feed == '' || $feed == 'feed') {
    $feed = 'rss2';
}

if ( is_single() || ($withcomments == 1) ) {
    require(ABSPATH . 'wp-commentsrss2.php');
} else {
    switch ($feed) {
    case 'atom':
        require(ABSPATH . 'wp-atom.php');
        break;
    case 'rdf':
        require(ABSPATH . 'wp-rdf.php');
        break;
    case 'rss':
        require(ABSPATH . 'wp-rss.php');
        break;
    case 'rss2':
        require(ABSPATH . 'wp-rss2.php');
        break;
    case 'comments-rss2':
        require(ABSPATH . 'wp-commentsrss2.php');
        break;
    }
}

?>
